home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 2.3 KB | 101 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWGrInit.cpp
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWOS.hpp"
-
- #ifndef FWGRINIT_H
- #include "FWGrInit.h"
- #endif
-
- #ifndef FWPRIRAS_H
- #include "FWPriRas.h"
- #endif
-
- #ifndef FWGRGLOB_H
- #include "FWGrGlob.h"
- #endif
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #ifndef FWGXUTIL_H
- #include "FWGXUtil.h"
- #endif
-
- #if defined(FW_BUILD_MAC) && !defined(__WINDOWS__)
- #include <Windows.h>
- #endif
-
- //========================================================================================
- // RunTime Info
- //========================================================================================
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- #ifdef FW_BUILD_MAC
- #pragma segment FWGraphics_Init
- #endif
-
- //========================================================================================
- // Globale Functions
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // ::InitGraphic
- //----------------------------------------------------------------------------------------
-
- void FW_FUNC_ATTR InitGraphic()
- {
- #ifdef FW_BUILD_MAC
- if (FW_gScratchWindow == NULL)
- {
- FW_SPlatformRect rBounds(0, 0, 10 , 10);
- FW_gScratchWindow = ::NewCWindow(NULL,
- &rBounds,
- "\p",
- FALSE,
- documentProc,
- NULL,
- FALSE,
- 0);
- }
- #endif
-
- #ifdef FW_SUPPORT_GX
- FW_GX_Initialize();
- #endif
-
- if (FW_gRasterizer == NULL)
- FW_gRasterizer = new FW_CPrivRasterizer;
- }
-
- //----------------------------------------------------------------------------------------
- // ::ShutdownGraphic
- //----------------------------------------------------------------------------------------
-
- void FW_FUNC_ATTR ShutdownGraphic()
- {
- #ifdef FW_BUILD_MAC
- FW_ASSERT(FW_gScratchWindow != NULL);
- ::DisposeWindow(FW_gScratchWindow);
- FW_gScratchWindow = NULL;
- #endif
-
- FW_ASSERT(FW_gRasterizer != NULL);
- delete FW_gRasterizer;
- FW_gRasterizer = NULL;
-
- #ifdef FW_SUPPORT_GX
- FW_GX_Terminate();
- #endif
- }
-